<?php
	define('_EXEC', 1);
	
	include_once ("config.php");
	include_once ("funcoes.php");
	include_once ("conexao.php");
	include_once ("alertas.php");
	
	if($status_session == "on"){
		session_start();
	}
	
	if(isset($_GET["s"]) && $_GET["s"] == 1){
		session_destroy();
		header("Location: index.php");
	}
	
	$p = $_GET["p"];
	$css = "class=\"active\"";
?>
<!DOCTYPE html>
<html lang="<?php echo $lang; ?>">
    <head>
		<meta charset="<?php echo $charset; ?>">
		<title><?php echo $title; ?></title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
		<link href="css/style.css" rel="stylesheet" type="text/css">
		<link href="css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
		<script src="http://code.jquery.com/jquery-latest.js"></script>
		<script type="text/javascript" src="js/bootstrap.js"></script>
		<!--[if lt IE 9]>
			<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
		<![endif]-->
    </head>
    <body>
		<div class="container span12">
			<div class="page-header span12">
				<div class="span6 pull-left">
					<div>
						<a href="index.php"><img src="img/somateria_logo200.png" alt="logo só matéria" width="200" height="39" border="0" title="Só Matéria" class="logo" /></a>
					</div>
					<div>
						<h4><?php echo $slogan; ?></h4>
					</div>
				</div>
				<div class="span6">
					
				</div>
			</div>
			
			<div class="container span12">
				<div class="row-fluid">
					<div class="span2">
						<!--conteúdo da lateral-->
						<div class="well sidebar-nav">
							<ul class="nav nav-list">
								<li <?php echo($p == "inicio" || $p == "" ) ? $css : ""; ?>><a href="index.php?p=inicio">Trabalhos publicados</a></li>
								<li class="divider"></li>
								<li <?php echo($p == "quemsomos") ? $css : ""; ?>><a href="index.php?p=quemsomos">Quem somos</a></li>
								<li class="divider"></li>
								<li <?php echo($p == "clientes") ? $css : ""; ?>><a href="index.php?p=clientes">Clientes</a></li>
								<li class="divider"></li>
								<li <?php echo($p == "blog") ? $css : ""; ?>><a href="index.php?p=blog">Beleza aos 55+</a></li>
								<li class="divider"></li>
								<li <?php echo($p == "contato") ? $css : ""; ?>><a href="index.php?p=contato">Contato</a></li>
							</ul>
						</div>
					</div>
					<div class="span10">
						<div class="row-fluid">
						
							<!--conteúdo do corpo-->
							<?php
								if(isset($_GET["a"])){
									echo alerta($_GET["a"]);
								}
								$pagina = array('erro','inicio','quemsomos','clientes','contato','materia','blog');
								if(!isset($_GET['p'])){
									include_once("inc/inicio.inc.php");
								}
								elseif (in_array($_GET['p'], $pagina)){
									include_once("inc/".$_GET['p'].".inc.php");
								}
								else{
									include_once("inc/erro.inc.php");
								}
							?>
						</div>
					</div>
				</div>
			</div>
			
			<div class="modal-footer container span12">
				<footer>
					<div id="social-info" class="pull-right">
						<ul>
							<li class="muted credit"><strong>Siga a <?php echo $nomeEmpresa ?></strong></li>
							<li><a id="facebook" href="https://www.facebook.com/pages/S%C3%B3-Mat%C3%A9ria/224497570977879?ref=ts&fref=ts" title="Só Matéria no Facebook" target="_blank"></a></li>
						</ul>
					</div>
					<div class="pull-left">
						<p class="muted" style="text-align:left;"><?php echo $nomeEmpresa ?> <a href="/adm/" class="muted">2008</a> - <?php echo date("Y"); ?><br />Todos os Direitos Reservados&copy;</p>
					</div>
				</footer>
			</div>
		</div>
    </body>
</html>